import { useReducer } from "react";
const useMyReducer = () => {
    const initState = {
        city: "武汉"
    }
    const reducer = (state, action) => {
        if (action.type === "changeCity") {
            return {
                city: action.val
            }
        }else{
            return state
        }
    }
const [state, dispatch] = useReducer(reducer, initState)
return [state, dispatch];
}
export default useMyReducer;

